public class demo3 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() ->{
            try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("ok,执行完成");
        });
        Thread thread0 = new Thread(() ->{
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("0");
        });
        Thread thread1 = new Thread(() ->{
            try {
                Thread.sleep(1000);
                thread0.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("1");
        });
        Thread thread2 = new Thread(() ->{
            try {
                Thread.sleep(1000);
                thread1.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("2");
        });
        Thread thread3 = new Thread(() ->{
            try {
                Thread.sleep(1000);
                thread2.join();
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("3");
        });
        thread0.start();
        thread1.start();
        thread2.start();
        thread3.start();
        thread.start();




    }
}

